//引入包
var gulp=require ('gulp');

var cleanCss=require('gulp-clean-css');
var uglify=require('gulp-uglify');
var concat=require('gulp-concat');
var connect=require('gulp-connect');
var sass=require('gulp-ruby-sass');


//task命令：新建信息
gulp.task('sass',function(){
	return sass('./css/src/*.scss').pipe(gulp.dest('./css/dist'))
})

//task命令：新建信息
gulp.task('js',function(){
	return gulp.src('./js/src/*.js').pipe(gulp.dest('./js/dist'))
})


//新建刷新任务
gulp.task('reload',['sass','js'],function(){
	gulp.src('./*.html').pipe(connect.reload());
})

//新建默认的任务
gulp.task('default',['sass','js'],function(){
	//开启服务器
	connect.server({
		livereload:true
	});
	//监听命令
	gulp.watch(['./css/src/*.scss','./js/src/*.js','./*.html'],['reload'])
});
